package com.spzx.channel.service.imp;

import com.spzx.channel.service.IListService;
import com.spzx.common.core.constant.ScheduleConstants;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.domain.R;
import com.spzx.common.core.web.page.TableDataInfo;
import com.spzx.product.api.RemoteProductService;
import com.spzx.product.api.domain.vo.SkuQuery;
import io.jsonwebtoken.lang.Assert;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ListServiceImpl implements IListService {
    @Resource
    RemoteProductService remoteProductService;
    @Override
    public TableDataInfo getProductSkuList(Integer pageNum, Integer pageSize, SkuQuery skuQuery) {
        R<TableDataInfo> tableDataInfoR= remoteProductService.skuList(pageNum,pageSize,skuQuery, SecurityConstants.INNER);
        Assert.isTrue(tableDataInfoR.getCode()==200, "远程调用失败");
        return tableDataInfoR.getData();
    }
}
